<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>函数防抖</title>
</head>
<body>
<input type="text" class="i1"/>
<script>
    var oIput=document.querySelector(".i1");
    oIput.onkeyup=denuce.bind(oIput);
    var timer;
    function denuce(){
        var that=this;
        clearTimeout(timer);
        timer=setTimeout(function(){
            console.log(that.value)
        },500);
    }
</script>
</body>
</html>